﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using BySoft.Web.Utility;
using System.Data;
using BySoft.Server.Business;
using System.Web;
using BySoft.Server.Common.Enum;
using BySoft.Server.Common;
using BySoft.Server.Common.Entity;
using BySoft.Web.Site;

namespace BySoft.Web.Site.SysManage
{
    public partial class FormAuditView : AuthBasePage
    {
        #region 初始化及绑定控件
        private void InitData()
        {
			string strCode = HttpUtility.UrlDecode(UIHelper.GetQueryStringValue("id").Trim());
			InitHead(strCode);
            InitBody(strCode);
        }

		private void InitHead(string strCode)
        {
            DataTable dt = SysFormaudit.SelectHead(strCode);
            DBtoControlHead(this.Page, dt, tBase, @"../SysManage/FormAuditList.aspx");
        }

        private void InitBody(string strCode)
        {
            DataTable dt = SysFormaudit.SelectBody(strCode);
            BindData(dt);
        }
        #endregion

        #region 控件事件
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
				grdResult.Style.Add("word-break", "keep-all");
                grdResult.Style.Add("word-wrap", "normal");
                InitData();
            }
			UIHelper.RunScript(this.UpdatePanel1, "Refreashtab();");
        }

		private void BindData(DataTable dt)
        {
            if (dt.Rows.Count > 0)
            {
                grdResult.DataSource = dt;
                grdResult.DataBind();
            }
            else
            {
                UIHelper.BindEmptyGridView(grdResult, dt);
            }
            UIHelper.RunScript(this.UpdatePanel1, "iframeAutoFit();");
        }
		#endregion
    }
}

